import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from "axios";


import { Button, Toast, Popup, Lazyload, Swipe, SwipeItem, Image as VanImage, Field, Picker, Checkbox, CheckboxGroup, SwipeCell, Dialog, ActionSheet, Tab, Tabs, PullRefresh, Skeleton, Uploader, List, Notify, Calendar,Icon} from 'vant'
Vue.use(Button)
Vue.use(Toast)
Vue.use(Popup)
Vue.use(Lazyload)
Vue.use(Swipe)
Vue.use(SwipeItem)
Vue.use(VanImage);
Vue.use(Field);
Vue.use(Picker);
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
Vue.use(SwipeCell);
Vue.use(Dialog);
Vue.use(ActionSheet);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(PullRefresh);
Vue.use(Skeleton);
Vue.use(Uploader);
Vue.use(List);
Vue.use(Notify);
Vue.use(Calendar);
Vue.use(Icon);
Vue.config.productionTip = false

axios.interceptors.request.use(
  function(request) {
    //request.headers["Api-Version"] = config.apiVersion;
    //request.headers["Device-Type"] = config.deviceType;
    //request.headers["Channel-Key"] = config.channelKey;
    return request;
  },
  function(error) {
		return Promise.reject(error);
  }
);
axios.interceptors.response.use(
  function(response) {
    // 配置请求回来的信息
    //console.log('数据加载完成....')
    return response;
  },
  function(error) {
		Notify('网络连接失败');
    return Promise.reject(error);
  }
);
Vue.prototype.$http = axios;


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
